
const getSectionInfo = (callback) => {
    $.getJSON(GLOBAL_allsection, function(res) {
        callback(res.data);
    });
};
const renderSectionView = (data,elem, defaultid) => {
        let sectionOptionHtml = '<option value="0">请选择部门</option>';
    $.each(data, (key, val) => {
        let option = `<option value=${val.id}>${val.name}</option>`;
        if (defaultid && parseInt(defaultid, 10) === parseInt(val.id, 10)) {
            option = `<option value=${val.id} selected>${val.name}</option>`;
        }
        sectionOptionHtml += option;
    });
    $(elem).html(sectionOptionHtml);
};


export{getSectionInfo,renderSectionView}